package com.af.monitorModule.controller.server;


import com.af.monitorModule.generator.mapper.ServerPushMapper;
import com.af.monitorModule.generator.service.ServerPushService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/serverPush")
public class ServerPushDataController {

    @Autowired
    private ServerPushService serverPushService;

    @GetMapping("/getShowLine")
    public JSONObject getShowLine(String serverId,String hours){
        return serverPushService.getShowLine(serverId,hours);
    }

    @GetMapping("/getAll")
    public JSONObject getAllServer(){
        return  serverPushService.getAll();
    }
}
